package com.knoya.chejian.pda.module.shezhi

import android.view.View
import com.knoya.chejian.pda.R
import com.knoya.chejian.pda.activity.BaseActivity
import com.knoya.chejian.pda.util.Myutil
import kotlinx.android.synthetic.main.activity_yuzupan_shezhi.*
import kotlinx.android.synthetic.main.header_knoya.*

class YuZupanShezhiActivity: BaseActivity(), View.OnClickListener {
    lateinit var cangku: String
    override fun getLayoutId(): Int {
        return R.layout.activity_yuzupan_shezhi
    }

    override fun initCreate() {
        tv_header_title.text = "预组盘仓位"
        iv_header_left.visibility = View.VISIBLE
        iv_header_left.setOnClickListener(this)
        cangku = sp.getString("yuzupancangku","")
        Et_Cangku.setText(cangku)
        Bt_Xiugai.setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        when(v){
            Bt_Xiugai -> {
                editor.putString("yuzupancangku",Et_Cangku.text.toString().trim())
                editor.commit()
                Myutil.MyTost("保存成功")
            }
            iv_header_left ->{
                finish()
            }
        }
    }
}